package config

import (
	"gitee.com/liuxuezhan/ar-platform/assets-rpc/internal/dao/schema"
)

const TableNameConfigInoutType = "config_inout_type"

const (
	TagTypeAdd = 1
	TagTypeSub = 2
)

// ConfigInoutType 余额变动类型
type ConfigInoutType struct {
	schema.Model
	Id         int64   `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
	TypeId     int64   `gorm:"column:type_id;type:bigint(20);comment:余额变动类型;NOT NULL" json:"type_id"`
	Name       string  `gorm:"column:name;type:varchar(100);comment:余额变动类型名字;NOT NULL" json:"name"`
	Value      float64 `gorm:"column:value;type:float;default:0;comment:配置值;NOT NULL" json:"value"`
	CreatedUid int64   `gorm:"column:created_uid;type:bigint(20);default:0;comment:创建人;NOT NULL" json:"created_uid"`
	UpdatedUid int64   `gorm:"column:updated_uid;type:bigint(20);comment:更新人;NOT NULL" json:"updated_uid"`
	TagType    int     `gorm:"column:tag_type;type:tinyint(4);default:0;comment:1:加，2：减;NOT NULL" json:"tag_type"`
	Remark     string  `gorm:"column:remark;type:varchar(255);default:'';comment:备注;NOT NULL" json:"remark"`
}

func (*ConfigInoutType) TableName() string {
	return TableNameConfigInoutType
}

const (
	TYPE_RECHARGE       int64 = 10  // 会员充值
	TYPE_RECHARGE_FIRST int64 = 17  // 会员首充
	TYPE_RECHARGE_C2C   int64 = 71  // C2C 充值
	TYPE_RECHARGE_HAND  int64 = 102 // 手动充值

	TYPE_WITHDRAWAL        int64 = 20 // 提现
	TYPE_WITHDRAWAL_CANCEL int64 = 21 // 提现撤销
	TYPE_ACTIVITY_REWARD   int64 = 30
	TYPE_MANNUAL_RECHARGE  int64 = 102 // 人工提现
	TYPE_GAME_BETTING      int64 = 103 // 游戏下注
	TYPE_BET_REBATE        int64 = 106 // 投注返水
)

// 71	C2C 充值
// 102	手动充值

var TypeRecharge = map[int64]struct{}{
	TYPE_RECHARGE:       {}, // 会员充值
	TYPE_RECHARGE_FIRST: {}, // 会员首充
	TYPE_RECHARGE_C2C:   {}, // C2C 充值
	TYPE_RECHARGE_HAND:  {}, // 手动充值
}

var TypeWithdraw = map[int64]struct{}{
	TYPE_WITHDRAWAL: {}, // 提现
}
